<template>
  <div>
    <el-form
      class="demo-form-inline"
      :inline="true"
      :model="form"
      style="padding-top: 10px; margin-left: 10px"
    >
      <el-form-item label="家长名">
        <el-input v-model="form.cus_name" placeholder="家长名" />
      </el-form-item>
      <el-form-item label="家长手机号">
        <el-input v-model="form.tel" placeholder="家长手机号" />
      </el-form-item>

      <el-form-item>
        <el-button type="primary" @click="onSubmit">查询</el-button>
      </el-form-item>
    </el-form>
    <el-table :data="tableData" style="width: 100%">
      <el-table-column label="家庭组" prop="group_name" />
      <el-table-column label="家长" prop="cus_name" />
      <el-table-column label="手机号" prop="tel" />
      <el-table-column label="操作" prop="">
        <template slot-scope="scoped">
          <el-button @click="deletl(scoped.row)">编辑</el-button>
        </template>
      </el-table-column>
    </el-table>
  </div>
</template>

<script>
  // // import { cusGroupDetail } from '@/api/level'
  import { cusList } from '@/api/customer'

  export default {
    components: {},
    props: {
      // dataList: {
      //   type: Object,
      //   required: true,
      // },
    },
    data() {
      return {
        tableData: [],
        form: {
          cus_name: '',
          tel: '',
        },
        formInline: {
          user: '',
          region: '',
        },
        total: '',
      }
    },
    watch: {},

    mounted() {
      // this.init() 进入页面 不调用列表
    },
    methods: {
      init() {
        cusList(this.form).then((e) => {
          this.tableData = e.data.data
          console.log(e)
        })
      },
      onSubmit() {
        this.form.page = 1
        this.init()
      },
      deletl(e) {
        console.log(e)
      },
    },
  }
</script>

<style></style>
